<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看手机号')"/>
</head>

<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-migrate-update" enctype="multipart/form-data">
        <input type="hidden" th:value="${merchant.merno}" id="merno">
        <input type="hidden" th:value="${merchant.apply_id}" id="apply_id">
        <h4 class="form-header h4">商户结算费率</h4>
        <div class="form-group" style="margin-left: 15px;margin-bottom: 35px;">
            <table class="col-sm-10 select-table table-striped">
                <tr style="height: 30px;">
                    <th>消费类型</th>
                    <th>商户类别</th>
                    <th>结算周期</th>
                    <th>卡类型</th>
                    <th>费率</th>
                    <th>附加</th>
                    <th>封顶</th>
                </tr>
                <tr style="height: 30px;" th:each="rate:${merchantRateList}">
                    <td th:if=" ${rate.rate_type} == '0'">传统银行卡收单</td>
                    <td th:if=" ${rate.rate_type} == '1'">银联云闪付</td>
                    <td th:if=" ${rate.rate_type} == '2'">微信</td>
                    <td th:if=" ${rate.rate_type} == '3'">支付宝</td>
                    <td th:if=" ${rate.rate_type} == '4'">银联二维码</td>
                    <td th:if=" ${rate.mer_category} == '0'">标准类</td>
                    <td th:if=" ${rate.mer_category} == '1'">优惠类</td>
                    <td th:if=" ${rate.mer_category} == '2'">减免类</td>
                    <td th:if=" ${rate.settle_type} == '0'">D0</td>
                    <td th:if=" ${rate.settle_type} == '1'">T1</td>
                    <td th:if=" ${rate.card_type} == '1'">借记卡</td>
                    <td th:if=" ${rate.card_type} == '2'">贷记卡</td>
                    <td th:if=" ${rate.card_type} == '3'">预付费卡</td>
                    <td>[[${rate.armark_fl}]]</td>
                    <td th:if=" ${rate.fjp} == null">0</td>
                    <td th:if=" ${rate.fjp} != null">[[${rate.fjp}]]</td>
                    <td th:if=" ${rate.armark_fd} == null">0</td>
                    <td th:if=" ${rate.armark_fd} != null">[[${rate.armark_fd}]]</td>
                </tr>
            </table>
        </div>

        <h4 class="form-header h4">上游商户信息</h4>
        <div class="form-group">
            <label class="col-sm-2 control-label  is-required">商户中文名：</label>
            <div class="col-sm-2">
                <input name="merNo" readonly type="text" class="form-control" id="mchtNm" required>
            </div>
            <label class="col-sm-2 control-label  is-required">商户状态：</label>
            <div class="col-sm-2">
                <input id="mchtStatus" readonly type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label is-required">联系手机：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="commTel" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label is-required">法人证件有效日期：</label>
            <div class="col-sm-2">
                <input readonly id="certExpdate" type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label  is-required">账户号：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="settleAcctNo" required>
            </div>
            <label class="col-sm-2 control-label  is-required">银行预留手机号：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="settleBindTel" required>
            </div>

        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">手续费方式：</label>
            <div class="col-sm-2">
                <input readonly id="feeType" type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label is-required">提现服务费(元)：</label>
            <div class="col-sm-2">
                <input readonly id="cashFeeAmt" type="text" class="form-control" required>
            </div>
        </div>

        <h4 class="form-header h4">上游费率信息</h4>
        <div class="form-group">
            <label class="col-sm-2 control-label  is-required">借记卡-比例：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="dcRate" required>
            </div>
            <label class="col-sm-2 control-label  is-required">贷记卡-比例：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="ccRate" required>
            </div>
            <label class="col-sm-2 control-label is-required">贷记卡-封顶：</label>
            <div class="col-sm-2">
                <input readonly id="ccMax" type="text" class="form-control" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">借记卡-封顶：</label>
            <div class="col-sm-2">
                <input readonly id="dcMax" type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label  is-required">微信支付宝：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="alipayFee" required>
            </div>
            <label class="col-sm-2 control-label  is-required">微信支付宝-被扫：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="alipaySweptFlag" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label is-required">云闪付优惠-借记卡：</label>
            <div class="col-sm-2">
                <input readonly id="feeRateDNfc" type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label is-required">云闪付优惠-贷记卡：</label>
            <div class="col-sm-2">
                <input readonly id="feeRateCNfc" type="text" class="form-control" required>
            </div>
            <label class="col-sm-2 control-label  is-required">借记卡优惠：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="emporiumPreferenceDebitFee" required>
            </div>
        </div>
        <div class="form-group">

            <label class="col-sm-2 control-label  is-required">借记卡优惠封顶：</label>
            <div class="col-sm-2">
                <input readonly type="text" class="form-control" id="emporiumPreferenceDebitAmt" required>
            </div>
            <label class="col-sm-2 control-label is-required">贷记卡优惠：</label>
            <div class="col-sm-2">
                <input readonly id="emporiumPreferenceCreditFee" type="text" class="form-control" required>
            </div>
        </div>
        <div style="margin-left: 40%">
            <span id="msg" style="color: red"></span>
        </div>

    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

</script>
</body>
</html>
<script>
  /**
   * 获取上游商户信息
   */
  var init = function () {
    var data = {"merno": $("#merno").val(), "apply_id": $("#apply_id").val()};
    $.ajax({
      type: "post",
      url: "getNewRateInfo",
      data: data,
      error: function (response) {
        $.modal.alertError("请求接口失败");
      },
      success: function (result) {
        console.log(result);
        if (result.hasOwnProperty('message')) {
          $("#msg").text(result.message);
          return;
        }
        if (result.code == "0") {
          $("#msg").text('');
          $("#mchtNm").val(result.data.mchtNm);
          if (result.data.mchtStatus == '0') {
            $("#mchtStatus").val('正常');
          }else if (result.data.mchtStatus == '1') {
              $("#mchtStatus").val('添加待终审');
          }else if (result.data.mchtStatus == 'B') {
              $("#mchtStatus").val('添加待初审');
          }else if (result.data.mchtStatus == '3') {
              $("#mchtStatus").val('变更待初审');
          }else if (result.data.mchtStatus == '5') {
              $("#mchtStatus").val('冻结待审核');
          }
          else if (result.data.mchtStatus == '6') {
            $("#mchtStatus").val('停用');
          }else if (result.data.mchtStatus == '7') {
              $("#mchtStatus").val('恢复待审核');
          }else if (result.data.mchtStatus == '8') {
              $("#mchtStatus").val('注销');
          }else if (result.data.mchtStatus == '9') {
              $("#mchtStatus").val('注销待审核');
          } else if (result.data.mchtStatus == 'A') {
            $("#mchtStatus").val('添加初审退回');
          } else if (result.data.mchtStatus == '2') {
            $("#mchtStatus").val('添加终审退回');
          }else if (result.data.mchtStatus == '4') {
              $("#mchtStatus").val('变更待终审');
          }else if (result.data.mchtStatus == 'C') {
              $("#mchtStatus").val('拒绝');
          }else if (result.data.mchtStatus == 'D') {
              $("#mchtStatus").val('暂存未提交');
          } else if (result.data.mchtStatus == 'E') {
            $("#mchtStatus").val('变更初审退回');
          } else if (result.data.mchtStatus == 'F') {
            $("#mchtStatus").val('变更终审退回');
          }
          $("#certExpdate").val(result.data.certExpdate);
          $("#commTel").val(result.data.commTel);
          $("#settleBindTel").val(result.data.settleBindTel);
          $("#settleAcctNo").val(result.data.settleAcctNo);
          if (result.data.feeType == '1') {
            $("#feeType").val('比例+封顶');
          } else {
            $("#feeType").val(result.data.feeType);
          }
          $("#dcRate").val(result.data.dcRate + '%');
          $("#ccRate").val(result.data.ccRate + '%');
          if (result.data.ccMax == '-1') {
            $("#ccMax").val('不封顶');
          } else {
            $("#ccMax").val(result.data.ccMax + '%');
          }
          $("#dcMax").val(result.data.dcMax);
          $("#cashFeeAmt").val(result.data.cashFeeAmt);
          $("#feeRateDNfc").val(result.data.feeRateDNfc + '%');
          $("#feeRateCNfc").val(result.data.feeRateCNfc + '%');
          if (result.data.alipaySweptFlag == '1') {
            $("#alipaySweptFlag").val('是');
          } else {
            $("#alipaySweptFlag").val('否');
          }
          $("#alipayFee").val(result.data.alipayFee + '%');
          $("#emporiumPreferenceDebitFee").val(result.data.emporiumPreferenceDebitFee + '%');
          var epd = result.data.emporiumPreferenceDebitAmt;
          if (epd != '') {
            if (epd == '-1') {
              $("#emporiumPreferenceDebitAmt").val('不封顶');
            } else {
              $("#emporiumPreferenceDebitAmt").val(epd);
            }
          } else {
            $("#emporiumPreferenceDebitAmt").val('0');
          }
          $("#emporiumPreferenceCreditFee").val(result.data.emporiumPreferenceCreditFee + '%');

        }else if (result.code == "500"){
          $("#msg").text(result.msg);

        }
      }
    });
  }();
</script>
